home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.098 < prev    next >
Encoding:
Text File  |  1992-07-15  |  3.8 KB  |  82 lines  |  [TEXT/GEOL]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5. Apple IIgs
  6. #98: Aren't Windows A Pane?
  7.  
  8. Revised by: Dave Lyons                                              May 1992
  9. Written by: Dave Lyons                                          January 1991
  10.  
  11. This Technical Note describes interesting Window Manager things.
  12.  
  13. CHANGES SINCE JANUARY 1991:  Noted that in System 6.0 it's safe to use Window
  14. color table resources.  Added a section on changing the desktop pattern or
  15. picture.
  16. _____________________________________________________________________________
  17.  
  18.  
  19. CHANGING THE DESKTOP PATTERN OR PICTURE
  20.  
  21. The best way to set a new desktop pattern or picture is as follows.  This
  22. works with the Finder and other desktop applications.
  23.  
  24.    1. Use MessageCenter to delete message 2, the desktop message.  (If there
  25.       wasn't one, that's fine--there still isn't.)
  26.    2. Use MessageCenter to create a new message 2, containing the pattern or
  27.       picture you want (see the Window Manager chapter of Apple IIgs Toolbox
  28.       Reference, Volume 3).
  29.    3. Call Desktop (in the Window Manager) with a deskTopOp of 8 and a
  30.       dtParam of $00000000.  This notifies any part of the system that cares
  31.       (such as the Finder) that there is a new desktop pattern.
  32.    4. Call Desktop with a deskTopOp of 4 and a dtParam of $00000000 and keep
  33.       the result.
  34.    5. Call Desktop with a deskTopOp of 5 and use the result from step 4 as
  35.       dtParam.  This sets the desktop pattern to what it already is, forcing
  36.       the desktop to redraw (this works whether a pattern, picture, or
  37.       pointer to desktop-drawing routine is involved).
  38.  
  39.  
  40. A WARNING ABOUT WINDOW COLOR TABLE HANDLES AND RESOURCES
  41.  
  42. The System 6.0 Window Manager fixes the problem described below.  If your
  43. application requires System 6, you can safely ignore this section.
  44.  
  45. All versions of the Window Manager that support window color tables specified
  46. as handles or resources, up to and including System Software 5.0.4, work
  47. unreliably when a standard window's color table is supplied by handle or
  48. resource ID.
  49.  
  50. The problem is not immediately obvious; only one bit of memory is accidentally
  51. cleared, but the address is unpredictable in advance.  (When unlocking the
  52. color table handle, the standard window definition procedure attempts to
  53. unlock the handle manually by turning off bit 15 of word offset +4 in the
  54. master pointer record.  But it gets the high and low words of the handle
  55. reversed and usually turns off bit 15 of the word at offset $80E4 or $80E5 in
  56. some bank of RAM determined by the low byte of the handle.)
  57.  
  58. The solution is to avoid supplying color table handles or resource IDs to the
  59. Window Manager.  Supply color table pointers instead. You can get a color
  60. table pointer from a color table resource ID by calling LoadResource on the
  61. color table resource, locking the handle and dereferencing it.  Memory is less
  62. fragmented if color table resources used in this way are marked as attrFixed.
  63.  
  64. One method is to put the window color table pointer into the window template
  65. before calling NewWindow2.  If you are creating the window from an rWindParam1
  66. resource, you need to use LoadResource to get the template into RAM so that
  67. you can stuff the color table pointer into the template.  (Be sure to change
  68. the moreFlags field to indicate that the color table is a pointer, if the
  69. template indicates it's a resource.)  After you create the window with
  70. NewWindow2 (by handle), use ReleaseResource to release the rWindParam1
  71. resource.
  72.  
  73. Another method is to create the window as invisible and pass the window color
  74. table pointer to SetFrameColor before calling ShowWindow.
  75.  
  76.  
  77. Further Reference
  78. _____________________________________________________________________________
  79.  
  80.    o   Apple IIgs Toolbox Reference, Volumes 2-3
  81.  
  82.